home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / ic_part.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  59 lines

  1. /* IC_PART.H
  2.         BGI can not cut images at viewport borders, so we need
  3.         something like this.
  4. */
  5.  
  6. #ifndef __IC_PART_H_
  7. #define __IC_PART_H_
  8.  
  9. #include <graphics.h>
  10. #include "geom.h"
  11. #include "image_p.h"
  12.  
  13. #define N_PLANE_SH 2   // Use: x << 2
  14. #define N_PLANES 4     // Standart number of planes
  15.  
  16. /*
  17.     Image is the area in memory. After the cut_image_horiz or cut_image_vert
  18.     call we have new (cut) image in the same area. This speed up the work
  19.     because we do not need to allocate new memory, but the initial image
  20.     will be destroyed.
  21. */
  22. extern void cut_image_vert(imageP image, int width, int leave_left);
  23. extern void cut_image_horiz(imageP image, int height, int leave_up);
  24. /////////////////////////
  25. /*
  26.     image_cut cut the image, keeping result in the other area of
  27.     memory. Images are one-line height.
  28.     Arguments: image - source image, work - destination image,
  29.                x - beetween image beginning and dest. beginning
  30.                (User should assign the work->xmax and work->ymax
  31.            correct values), bplin - in image, sz - size of work.
  32. */
  33. inline void image_cut(imageP image, imageP work, int x, int bplin, int sz);
  34. /////////////////////////
  35. /*
  36.     cut_image and cut works with image using cut_image_vert and
  37.     cut_image_horiz. Initial image will be destroyed. cut_image is used
  38.     in help view icon scrolling.    cut_image:|          cut:
  39.     It can not get the central      **********|***     *************
  40.     area of the image - only        *  leave  |  *     *c  _____   *
  41.     the periferial. cut uses two  ____________|  *     *u |leave|  *
  42.     calls to cut_image to obtain    *    cut     *     *t |_____|  *
  43.     any part of image.              **************     *************
  44. */
  45. extern void cut_image(imageP image, rect src, rect dest);
  46. extern void cut(imageP image, rect src);  // src - position of rectangle inside image
  47. /////////////////////////
  48. /*
  49.     put_image shows the image in the viewport using the call to
  50.     cut_image. ATTENTION!!! It can cut only periferial part of
  51.     the image.
  52. */
  53. extern void put_image_correct(imageP image, rect src);
  54.  
  55. extern void putimage(int x, int y, imageP image,    // for 25x80 cells screen, show
  56.           int* cells, imageP work,              // only cells, which are listed
  57.           int bplin, int mode = COPY_PUT);      // Do not use it for compatibility.
  58.  
  59. #endif __IC_PART_H_